package com.wendy.mapper;

import com.wendy.MyMapper;
import com.wendy.model.Resource;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zhuwending
 */
public interface ResourceMapper extends MyMapper<Resource> {

    /**
     * 根据uri查询资源
     *
     * @param url 资源uri
     * @return Resource
     */
    Resource findResourceByUrl(String url);

    /**
     * 查询所有Resource
     *
     * @return Resource集合
     */
    List<Resource> selectAllResource();

    /**
     * 根据权限和资源路径查询资源
     *
     * @param permissions 权限
     * @param uri         资源路径
     * @return 资源对象
     */
    Resource selectResourceByPermissionsAndPath(@Param("permissions") String permissions, @Param("uri") String uri);
}
